// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import '../theme/index.css'
import 'lib-flexible/flexible.js'
import ElementUI from 'element-ui';
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import './assets/iconfont/iconfont.css'
import 'font-awesome/css/font-awesome.css'
import 'iview/dist/styles/iview.css'
import 'element-ui/lib/theme-chalk/index.css';
import i18n from './i18n/i18n'
import store from './store'
import NProgress from 'nprogress'
import { filterAsyncRoutes } from '@/utils/asyncRouter.js'
import "./permission.js"
import '@/common/flexible.js';
import Icon from 'vue-awesome/components/Icon';
import { createApp } from 'vue'
NProgress.configure({ showSpinner: false }) // 进度条配置
// Vue.use(ElementUI)
// Vue.component('icon', Icon);
// Vue.config.productionTip = false

const whiteList = ['/login'] 
const app = createApp(App)
app.use(ElementPlus, { size: 'small', zIndex: 3000 });
app.mount('#app')
// router.beforeEach((to, from, next) => {
//     var token = sessionStorage.token
//     if (to.name !== 'Login' && token== undefined) {
//         if (whiteList.indexOf(to.path) !== -1) {
//             // 需要跳转的路由是否是whiteList中的路由，若是，则直接条状
//             next()
//         }else{
//             next({ name: 'Login' })
//         }
        
//     } 
//     else {

//         if (to.matched.length === 0) {
//             next('/404')
//         }
//         next()
//     }
// })


/* eslint-disable no-new */
// new Vue({
//   el: '#app',
//   router,
//   store,
//   i18n,
//   components: { App },
//   template: '<App/>'
// })
